<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		var arr=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
	//result=[[1,2,3,4,5],[6,7,8,9,10],[11]]
		var newArr=arr.reduce(function(pre,item,index,arr){
			//pre->[[1,2,3,4,5],[]]
			//arr->arr
			//slice(begin,end)
			var begin=index*5;
			var end=begin+5;
			var result=arr.slice(begin,end);
			//console.log(result);
			if(result.length){
				//子数组长度不为0
				pre.push(result);
			}
			return pre;

			//[[1,2,3,4,5],[]]
			//[[6,7,8,9,10]]
		},[]);
		console.log(newArr);



	</script>
</head>
<body>
	
</body>
</html>